home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 32 / 032.d81 / dragon chase (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  4KB  |  148 lines

  1. 5 poke55,255:poke56,47
  2. 10 ifpeek(12288)<>0orpeek(12289)<>0thenload"dragon.spr",8,1
  3. 20 ifpeek(14336)<>60orpeek(14337)<>102thenload"dragon.fnt",8,1
  4. 30 dim s$(4),s(5):tr$="uv[157][157][149]wx"
  5. 35 d$="[144]ab[157][157][157][157][157][157]tcdef[157][157][157][157][157][157]ghijklm[157][157][157][157][157][157][157]nopqrs"
  6. 40 v=53248:sc=0:lv=3:tm=2500:hs=0:p1=193:p2=195:lp=1
  7. 50 s$(0)="":forl=1to4:s$(l)=s$(l-1)+"":next
  8. 60 forl=0to5:s(l)=l*5+2:next
  9. 70 read fr,dr:iffr=0then80
  10. 75 goto70
  11. 80 gosub2000
  12. 170 gosub1500
  13. 180 pokev+4,40:pokev+5,76:pokev+6,240:pokev+7,200:pokev+8,136:pokev+9,116
  14. 190 pokev+10,134:pokev+11,52:pokev+12,137:pokev+13,216:pokev+21,126
  15. 200 c1=peek(v+30):c2=peek(v+31):x=137:y=216:rx=240:ry=200:bx=40:by=76
  16. 210 rem    main loop
  17. 220 poke2042,p1:p1=p1+1:ifp1=195thenp1=193
  18. 230 poke2043,p2:p2=p2+1:ifp2=197thenp2=195
  19. 240 jy=peek(56320)and15
  20. 250 ifjy=7thenx=x+3
  21. 260 ifjy=11thenx=x-3
  22. 270 ifjy=13theny=y+3
  23. 280 ifjy=14theny=y-3
  24. 281 ifjy=10thenx=x-3:y=y-3
  25. 282 ifjy=6thenx=x+3:y=y-3
  26. 283 ifjy=5thenx=x+3:y=y+3
  27. 284 ifjy=9thenx=x-3:y=y+3
  28. 286 ifx>244thenx=244
  29. 287 ifx<24thenx=24
  30. 288 ify>229theny=229
  31. 289 ify<50theny=50
  32. 290 pokev+12,x:pokev+13,y
  33. 300 c1=peek(v+30):ifc1>64then800
  34. 310 c2=peek(v+31):ifc2>63then805
  35. 320 onlpgosub500,600,700:lp=lp+1:iflp=4thenlp=1
  36. 330 goto220
  37. 490 rem    red dragon movement
  38. 500 q1=sgn(x-rx)+2:q2=sgn(y-ry)+2
  39. 510 on q1gosub530,530,540:onq2gosub550,550,560
  40. 520 ifrx<25thenrx=25
  41. 521 ifrx>244thenrx=244
  42. 522 ifry<76thenry=76
  43. 523 ifry>229thenry=229
  44. 525 pokev+6,rx:pokev+7,ry:return
  45. 530 rx=rx-sr:return
  46. 540 rx=rx+sr:return
  47. 550 ry=ry-sr:return
  48. 560 ry=ry+sr:return
  49. 590 rem    blue dragon movement
  50. 600 q1=sgn(x-bx)+2:q2=sgn(y-by)+2
  51. 610 on q1gosub630,630,640:onq2gosub650,650,660
  52. 620 ifbx<25thenbx=25
  53. 621 ifbx>244thenbx=244
  54. 622 ifby<76thenby=76
  55. 623 ifby>229thenby=229
  56. 625 pokev+4,bx:pokev+5,by:return
  57. 630 bx=bx-sb:return
  58. 640 bx=bx+sb:return
  59. 650 by=by-sb:return
  60. 660 by=by+sb:return
  61. 690 rem    time
  62. 700 tm=tm-10:iftm=0then1000
  63. 710 print""tab(33)"    ":print""tab(32)tm
  64. 720 return
  65. 790 rem    collisions
  66. 800 ifc1>95then900
  67. 805 forl=0to24:poke54272+l,0:next
  68. 810 pokev+23,14:pokev+29,14:poke2046,198
  69. 820 forl=0to8
  70. 830 p1=p1+1:ifp1=195thenp1=193
  71. 840 p2=p2+1:ifp2=197thenp2=195
  72. 850 poke2042,p1:poke2043,p2
  73. 860 poke54296,15:poke54277,80:poke54278,243:poke54275,4:poke54276,65
  74. 870 forz=20to140step5:poke54273,z:next
  75. 875 poke54276,64:next
  76. 880 lv=lv-1:print""tab(34)lv:iflv=0then1000
  77. 885 pokev+23,2:pokev+29,2:poke2046,192:pokev+21,2:gosub1600:goto180
  78. 890 rem    save princess
  79. 900 pokev+21,99:pokev+10,160:pokev+11,82:pokev+12,120:pokev+13,82
  80. 910 sc=sc+100+tm:print""tab(32)sc
  81. 920 gosub2500
  82. 930 pokev+21,2:gosub1600:goto180
  83. 990 rem    game over
  84. 1000 print"[147]":pokev+21,0:ifsc>hsthenhs=sc
  85. 1010 print""tab(12)"g a m e  o v e r"
  86. 1020 print""tab(14)"score  "sc:print:printtab(14)"high score  "hs
  87. 1030 print""tab(10)"play again - y or n"
  88. 1040 print""tab(23)d$
  89. 1050 print""tab(8)d$:print""tab(35)d$
  90. 1060 get jk$:ifjk$<>""then1060
  91. 1070 geti$:ifi$=""then1070
  92. 1080 if i$="y"then1100
  93. 1090 open15,8,15,"r0:hello connect=hello connect":input#15,er:close15
  94. 1091 print"[147]":ifer<>63thenend
  95. 1092 poke53272,21:load"hello connect",8
  96. 1100 sc=0:lv=3:tm=2500:gosub2080:goto170
  97. 1490 rem   set up playing screen
  98. 1500 print"[147]"tab(30)"[144]@[146] dragon!":printtab(30)"@"tab(37)"ab"
  99. 1510 printtab(30)"@[146]  tcdef":printtab(30)"@[146] ghijklm"
  100. 1520 printtab(30)"@[146] nopqrs":printtab(30)"@":printtab(30)"@[146]  time"
  101. 1530 printtab(30)"@[146]"tab(32)tm:printtab(30)"@":printtab(30)"@[146]"
  102. 1540 printtab(30)"@[146]":printtab(30)"@[146]  lives"
  103. 1550 printtab(30)"@[146]"tab(34)lv:forl=1to6:printtab(30)"@":next
  104. 1560 printtab(30)"@[146]  score":printtab(30)"@[146]"tab(32)sc:printtab(30)"@"
  105. 1570 printtab(30)"@[146]  high":printtab(30)"@[146]"tab(32)hs
  106. 1580 gosub1600:return
  107. 1590 rem    erase and draw new forest
  108. 1600 print"":forl=1to22:print"                             ":next
  109. 1610 forl=0toint(rnd(9)*20+tz):h=int(rnd(9)*6):co=int(rnd(9)*5)
  110. 1620 prints$(co)tab(s(h))tr$:next
  111. 1630 print""tab(12)tr$:print""tab(17)tr$
  112. 1640 return
  113. 2000 poke53272,(peek(53272)and240)or14
  114. 2080 poke2040,199:poke2041,197:poke2042,193:poke2043,195:poke2044,201
  115. 2082 poke2045,200
  116. 2085 poke2046,192:pokev+28,32:pokev+37,1:pokev+38,6:pokev+44,7:pokev+39,2
  117. 2090 pokev+40,12:pokev+41,6:pokev+42,2:pokev+43,0:pokev+45,1:pokev+29,2
  118. 2095 pokev,144:pokev+1,76:pokev+16,2:pokev+2,26:pokev+3,158:pokev+23,2
  119. 2100 rem    title screen
  120. 2110 poke53281,15:poke53280,0:print"[147]"
  121. 2120 printtab(2)"@@@"
  122. 2130 print" [144]@@[144]@@[146] nce upon a time,there were two..."
  123. 2140 print" [144]@@@@":print" [144]@@@":print""tab(13)"d r a g o n s !"
  124. 2150 print:print:printtab(9)"choose your skill level":print
  125. 2160 printtab(15)"1-beginner":print:printtab(15)"2-experienced":print
  126. 2170 printtab(15)"3-expert":print""tab(22)d$
  127. 2180 print""tab(8)d$:print""tab(35)d$
  128. 2190 get jk$:ifjk$<>""then2190
  129. 2200 geti$:ifi$=""then2200
  130. 2210 ifi$="1"thensr=5:sb=4:tz=10:return
  131. 2220 ifi$="2"thensr=5:sb=5:tz=15:return
  132. 2230 ifi$="3"thensr=6:sb=4:tz=20:return
  133. 2240 goto2200
  134. 2490 rem    song
  135. 2500 restore:forl=54272to54296:pokel,0:next
  136. 2510 poke54275,8:poke54277,41:poke54278,89:poke54286,117:poke54290,16
  137. 2520 poke54296,143
  138. 2530 readfr,dr:iffr=0thenreturn
  139. 2540 poke54276,65
  140. 2560 fq=fr+peek(54299)/2:hf=int(fq/256):lf=fqand255
  141. 2570 poke54272,lf:poke54273,hf:forl=1todr*40:next
  142. 2580 poke54276,64:goto2530
  143. 2900 rem    song data
  144. 2910 data 5103,8,10207,8,9634,4,7647,2,8583,2,9634,4,10207,4,5103,8,8583,4
  145. 2920 data 8583,4,7647,4,7647,4,7647,4,7647,4,4291,8,6812,8,6430,4,5103,2
  146. 2930 data 5728,2,6430,4,6812,4,5728,4,4817,2,5103,2,5728,4,6430,4,5103,12
  147. 2940 data 0,0
  148.